package com.kaishengit.util;

import java.text.DecimalFormat;

public class LongToFloat {
	public static String getFloat(float i){
		DecimalFormat df = new DecimalFormat("#.00");
		float t = i;
		String str = null;
		if(t < 1024){
			str = t + "B";
		}else if(t > 1024 && t < 1024 * 1024){
			t = Float.parseFloat(df.format(t / 1024));
			str = t+ "KB";
		}else if(t > 1024 * 1024 && t < 1024 * 1024 *1024){
			
			t = Float.parseFloat(df.format(t / 1024 / 1024));
			str = t  + "MB";
		}
		return str;
	}
}
